version: '3'

services:
  db:
    image: postgis/postgis
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_DB=db
      - POSTGRES_PASSWORD=password
    ports:
      - "5431:5432"

  zookeeper:
    image: zookeeper
    environment:
      - ZOOKEEPER_CLIENT_PORT=2181

  kafka:
    image: bitnami/kafka
    ports:
      - "29092:29092"
    environment:
      - KAFKA_BROKER_ID=1
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
      - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,EXTERNAL://localhost:29092
      - KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,EXTERNAL://:29092
      - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT
      - KAFKA_INTER_BROKER_LISTENER_NAME=PLAINTEXT
      - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1

  debezium:
    image: debezium/connect
    ports:
      - "8083:8083"
    environment:
      - BOOTSTRAP_SERVERS=kafka:9092
      - GROUP_ID=1
      - CONFIG_STORAGE_TOPIC=my_connect_configs
      - OFFSET_STORAGE_TOPIC=my_connect_offsets
      - STATUS_STORAGE_TOPIC=my_connect_statuses
    depends_on:
      - zookeeper
      - kafka

  elasticsearch:
    image: elasticsearch:7.17.21
    ports:
      - "9200:9200"
    environment:
      - discovery.type=single-node

  kafka-ui:
    container_name: kafka-ui
    image: provectuslabs/kafka-ui:latest
    ports:
      - 9000:8080
    environment:
      DYNAMIC_CONFIG_ENABLED: true

  tds-static:
    image: nginx
    ports:
      - "1234:80"
    volumes:
      - "./nginx-static.conf:/etc/nginx/conf.d/default.conf"
      - "C:/tds-static:/tds"